<?php
  include_once('../classes/class.edit.order.php');
    
  session_start();
    
  if (isset($_POST['type']))
  { 
    $editOrder = new EditOrder();  
    if($editOrder->process())
    {
     $comtec_id_machine = $_POST['comtec_id_machine'];
     echo "<script>alert('Orden de trabajo modificada satisfactoriamente');</script>";
     if($_POST['type']==1){
      echo "<script>loadOrders($comtec_id_machine)</script>";
     }elseif($_POST['type']==2){
      echo "<script>loadHome()</script>";   
     }elseif($_POST['type']==3){
      echo "<script>goBackSearch();</script>";
      echo "<script>searchOperations();</script>";
     }
    }else
       {
        echo '<p class="error">';
        echo '<b>'.$editOperation->show_errors().'</b>'; 
        echo '</p>';    
       }
  }
?>
